<template>
  <div class="container">
    <div>
      <el-row :gutter="3">
        <!-- <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="设施类型：" >
              <el-select v-model="form.LX" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.LX"
                  :label="item.LX"
                  :value="item.LX">
                </el-option>
              </el-select>
            </el-form-item>
            </el-form>
        </el-col> -->
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="考核日期：">
              <el-date-picker
                v-model="form.StartDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <!-- <el-form-item label="结束日期：">
              <el-date-picker
                v-model="form.EndDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item> -->
            <el-form-item label="被考核单位：" label-width="110px">
              <el-select v-model="form.QY" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.QY"
                  :label="item.QY"
                  :value="item.QY"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <!-- <el-form-item label="结束日期：">
              <el-date-picker
                v-model="form.EndDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item> -->
            <el-form-item label="考核类型：" label-width="110px">
              <el-select v-model="form.QY" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.QY"
                  :label="item.QY"
                  :value="item.QY"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <!-- <el-col :span="4">
          <el-form ref="form" :model="form" style="float: right">
            <el-button size="mini" type="primary" @click="getlistdata"
              >查 询</el-button
            >
            <!-- <el-button size="mini" type="success" @click="exportExcel">导 出</el-button> -->
          </el-form>
        </el-col>
      </el-row>
      <el-row :gutter="3">
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <el-form-item label="考核项目：">
              <el-select v-model="form.QY" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.QY"
                  :label="item.QY"
                  :value="item.QY"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="6">
          <el-form ref="form" :model="form">
            <!-- <el-form-item label="结束日期：">
              <el-date-picker
                v-model="form.EndDate"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
              ></el-date-picker>
            </el-form-item> -->
            <el-form-item label="当前状态：" label-width="95px">
              <el-select v-model="form.QY" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.QY"
                  :label="item.QY"
                  :value="item.QY"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
        </el-col>
        <el-col :span="4">
          <el-form ref="form" :model="form" style="float: left">
            <el-button size="mini" type="primary" @click="getlistdata"
              >查 询</el-button
            >
            <!-- <el-button size="mini" type="success" @click="exportExcel">导 出</el-button> -->
          </el-form>
        </el-col>
      </el-row>
    </div>
    <el-table
      v-loading="loading"
      :data="
        tableData.slice((currentPage - 1) * pageSize, currentPage * pageSize)
      "
      highlight-current-row
    >
      <el-table-column
        prop="责任单位名称"
        label="责任单位名称"
        align="center"
        width="210px"
      ></el-table-column>
      <!-- <el-table-column
        prop="REMARK"
        label="详情描述"
        align="center"
        width="150"
      ></el-table-column> -->
      <el-table-column
        prop="PLACENAME"
        label="考核项目"
        align="center"
        width="210px"
      ></el-table-column>
      <el-table-column
        prop="LOCATION"
        label="问题对象名称"
        align="center"
        width="250"
      ></el-table-column>
      <el-table-column
        prop="REMARK"
        label="考核类型"
        align="center"
        width="470px"
      ></el-table-column>
      <el-table-column
        prop="TIME"
        label="减分总数"
        align="center"
        width="210px"
      ></el-table-column>
      <el-table-column
        prop="当前状态"
        label="当前状态"
        align="center"
        width="210px"
      ></el-table-column>
      <el-table-column
        prop="考核内容"
        label="考核内容"
        align="center"
        width="210px"
      ></el-table-column>

      <!-- <el-table-column label="图片"  align="center">
        <template slot-scope="scope">
          <el-image
            style="width: 40px; height: 40px; margin-top: 12px;"
            :src="scope.row.PHOTO1"
            @click="bigImage(scope.row)"
          ></el-image>
        </template>
      </el-table-column> -->
      <!-- <el-table-column
        prop="STATUS"
        label="状态"
        align="center"
      ></el-table-column> -->
      <!-- <el-table-column label="播放" width="250">
        <template slot-scope="scope">
          <el-button v-if="scope.row.RecordPath"
            type="text"
            icon="el-icon-headset"
            @click="openRecording(scope.$index, scope.row)"
            >播放录音</el-button
          >
          <el-button v-if="scope.row.VideoPath"
            type="text"
            icon="el-icon-video-play"
            @click="playVideo(scope.$index, scope.row)"
            >播放视频</el-button
          >
        </template>
      </el-table-column> -->
      <el-table-column label="操作" align="center" width="250">
        <template slot-scope="scope"
          ><el-button type="text" @click="handleAdd(scope.$index, scope.row)"
            >详情</el-button
          >
          <!-- <el-button
            type="text"
            @click="guidanceRecord(scope.$index, scope.row)"
            >整改过程</el-button
          > -->
          <!-- <el-button
            type="text"
            @click="rectificationRecord(scope.$index, scope.row)"
            >考评初审</el-button
          > -->
          <el-button
            type="text"
            @click="rectificationRecord(scope.$index, scope.row)"
            >考核申诉</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        background
        layout="total, sizes, prev, pager, next, jumper"
        :current-page="currentPage"
        :page-size="pageSize"
        :total="tableData.length"
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
      ></el-pagination>
    </div>
    <el-dialog
      title="图片展示"
      :visible.sync="showBigDialogVisible"
      width="450px"
    >
      <el-carousel :interval="5000" arrow="always">
        <el-carousel-item v-for="item in imageList" :key="item">
          <img :src="item" style="height: 100%; width: 100%" alt="图片丢失了" />
        </el-carousel-item>
      </el-carousel>
    </el-dialog>
    <el-dialog
      title="视频展示"
      :visible.sync="showVideoDialogVisible"
      width="450px"
    >
      <video
        id="videoSource"
        style="width: 100%; height: 500px"
        :src="videoPath"
        controls="controls"
      >
        您的浏览器不支持 video 标签。
      </video>
      <!-- <video :ref="'videoPlayer' + index" :controls="isIn">
        <source :src="item.src" type="video/mp4" />
        您的浏览器不支持Video标签。
      </video>
      <i
        v-show="!isPlay"
        class="play-btn el-icon-video-play"
        @click="playVideo"
      ></i>
      <i
        v-show="isPlay && isIn"
        class="play-btn el-icon-video-pause"
        @click="pauseVideo"
      ></i> -->
    </el-dialog>

    <!-- 指导记录 -->
    <el-dialog title="整改过程" :visible.sync="showGuidanceVisible">
      <!-- <div>
            <el-row :gutter="1">
              <el-col :span="5">
                <el-form ref="form" :model="form" label-width="5.729vw">
                  <el-form-item label="接收班组长：">
                    <el-input v-model="form.name" placeholder="请输入姓名" style="width:150px;"></el-input>
                  </el-form-item>
                </el-form>
              </el-col>
              <el-col :span="8">
                <el-form ref="form" :model="form" style="float:right">
                  <el-form-item>
                    <el-button size="mini" type="primary" @click="screeningData">查 询</el-button>
                    <el-button size="mini" type="success" @click="handleAdd">添加指导</el-button>
                  </el-form-item>
                </el-form>
              </el-col>
            </el-row>
          </div> -->
      <div>
        <el-tabs type="border-card" style="min-height: 350px">
          <el-table :data="commandData" style="width: 100%" border>
            <el-table-column
              prop="TOPLACENAME"
              label="整改时间"
              align="center"
            ></el-table-column>
            <!-- <el-table-column label="指导内容" align="center" width="270px">
              <template slot-scope="scope">
                <el-popover trigger="click" placement="top">
                  <p>{{ scope.row.DETAIL }}</p>
                  <div slot="reference" class="name-wrapper">
                    <el-tag effect="dark">{{ scope.row.DETAIL }}</el-tag>
                  </div>
                </el-popover>
              </template>
            </el-table-column> -->
            <el-table-column
              prop="CREATETIME"
              label="整改描述"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="STATUS"
              label="图片"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="CREATETIME"
              label="指导时间"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="STATUS"
              label="指导意见"
              align="center"
            ></el-table-column>
          </el-table>
        </el-tabs>
      </div>
    </el-dialog>
    <!-- 申诉记录 -->
    <el-dialog title="申诉记录" :visible.sync="showRecordVisible">
      <div>
        <el-row :gutter="1">
          <el-col :span="8">
            <el-form ref="form" :model="form" style="float: left">
              <el-form-item>
                <el-button size="mini" type="success" @click="handleAdd1"
                  >申诉判定</el-button
                >
              </el-form-item>
            </el-form>
          </el-col>
        </el-row>
      </div>
      <div>
        <el-tabs type="border-card" style="min-height: 350px">
          <el-table :data="rectificationData" style="width: 100%" border>
            <el-table-column
              prop="PLACENAME"
              label="考核日期"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="LOCATION"
              label="区域"
              align="center"
            ></el-table-column>
            <el-table-column label="作业单位" align="center">
              <template slot-scope="scope">
                <el-popover trigger="click" placement="top">
                  <p>{{ scope.row.REMARK }}</p>
                  <div slot="reference" class="name-wrapper">
                    <el-tag effect="dark">{{ scope.row.REMARK }}</el-tag>
                  </div>
                </el-popover>
              </template>
            </el-table-column>
            <el-table-column
              prop="TIME"
              label="考核项目"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="TIME"
              label="考核对象"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="TIME"
              label="考核内容"
              align="center"
            ></el-table-column>
            <el-table-column label="申诉图片" align="center">
              <template slot-scope="scope">
                <el-image
                  style="width: 40px; height: 40px; margin-top: 12px"
                  :src="scope.row.PHOTO1"
                  @click="bigImage(scope.row)"
                ></el-image>
              </template>
            </el-table-column>
            <el-table-column
              prop="TIME"
              label="申述内容"
              align="center"
            ></el-table-column>
          </el-table>
        </el-tabs>
      </div>
    </el-dialog>

    <!-- 添加指导 -->
    <el-dialog
      :title="addDialogTitle"
      :visible.sync="isVisibleEdit"
      width="50%"
    >
      <el-form ref="form" :model="form" label-width="5.729vw">
        <el-form-item label="指导内容：" style="height: 175px">
          <el-input
            type="textarea"
            :rows="9"
            v-model="form.guidance"
            :placeholder="请输入"
            class="handle-input mr10"
            style="width: 37.5vw; border: 1px solid #a4aca7"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="isVisibleEdit = false">取 消</el-button>
        <el-button type="primary" @click="addCommand()">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :title="addDialogTitle"
      :visible.sync="isVisibleEdit1"
      width="50%"
    >
      <el-form ref="form" :model="form" label-width="5.729vw">
        <el-form-item label="指导内容：" style="height: 175px">
          <el-input
            type="textarea"
            :rows="9"
            v-model="form.guidance"
            :placeholder="请输入"
            class="handle-input mr10"
            style="width: 37.5vw; border: 1px solid #a4aca7"
          ></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="isVisibleEdit = false">取 消</el-button>
        <el-button type="primary" @click="addCommand1()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import '@/assets/css/common.css'
import { formatDate } from '@/common/js/date.js'

import export2Excel from '@/utils/exportExcel/index.js'
import BenzAMRRecorder from 'benz-amr-recorder'
export default {
  data () {

    return {

      options: [
        { LX: '转运站' },
        { LX: '处理厂' },
        { LX: '垃圾点' },],
      select: {
        name: ''
      },
      currentPage: 1, //初始页
      pageSize: 10,    //    每页的数据
      srcBig: '',
      imageList: [],
      playRec: null,
      videoPath: '',
      showBigDialogVisible: false,
      showVideoDialogVisible: false,
      showRecordVisible: false,
      showGuidanceVisible: false,
      isVisibleEdit: false,
      isVisibleEdit1: false,
      form: {
        groupingList: [],
        groupingValue: '',
        cphList: [],//车牌号列表
        guidance: '',
        alermTypeList: [{ label: '1分钟', value: '1' }, { label: '5分钟', value: '5' }, { label: '10分钟', value: '10' }, { label: '30分钟', value: '30' }],
        alermTypeValue: '5',
        StartDate: formatDate(new Date(new Date() - 3600 * 1000 * 24 * 30), 'yyyy-MM-dd'),
        EndDate: formatDate(new Date(), 'yyyy-MM-dd 23:59:59'),
        LX: "转运站",
        name: "",
        PeopleNumber: '1',
        VehicleNumber: '0',

      },
      client: '',
      clientList: [],
      teamList: [],
      carteam: '',
      carteamList: [],
      carList: [],
      car: [],
      team: [],
      originalData: [],
      StationData: [],
      tableData: [],
      commandData: [],
      rectificationData: [],
      loading: false,
      URLByTYPE: ''
    }
  },
  created () {
    // this.getTeamList()
    // this.getcarTeamList()
  },
  mounted () {
    // if (localStorage.getItem('CurrentService') === '001') {
    //   this.URLByTYPE = 'Vehicle'
    // }
    // if (localStorage.getItem('CurrentService') === '003') {
    //   this.URLByTYPE = 'RubbishVehicle'
    // }

    this.getlistdata()
    // this.screeningData()
    // this.getcommandData()
    // this.getGroupingList()
  },
  methods: {
    //获取转运站列表
    async getlistdata () {
      // var url = 'RubbishVehicle/GetFeedbackInfoNew?PlaceType=公厕' + '&StartTime=' + this.form.StartDate + '&EndTime=' + this.form.EndDate
      // const { data } = await this.$Http.get(url)
      // this.tableData = data
      this.tableData = [{"责任单位名称":"标段","VID":"564","NAME":null,"PLACENAME":"道路机扫-道路","TIME":"10","当前状态":"申诉中","TYPEDETAIL":"问题反馈","PARENT_ID":"0","TITLE":"广场临时厕所","LONGITUDE":"117.378275","LATITUDE":"39.169349","LOCATION":"弘泽大街广场","REMARK":"日常检查","AUDIO":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20211103_102426.amr","VIDEO":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20211102_050843.3gp","PHOTO1":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1褚来友IMG_20211102_171008.jpg","PHOTO2":"","PHOTO3":"","PHOTO4":"","PHOTO5":"","PHOTO6":"","PHOTO7":"","PHOTO8":"","PHOTO9":"","CLIENT_NO":null,"CLIENT_NAME":null},{"ID":"29","VID":"565","NAME":null,"PLACENAME":"第二菜市场公厕","TIME":"2021/11/2 10:23:12","TYPE":"2","TYPEDETAIL":"问题反馈","PARENT_ID":"0","TITLE":"第二菜市场公厕","LONGITUDE":"117.409707","LATITUDE":"39.172199","LOCATION":"华一路与华七道交口","REMARK":"水龙头漏水厉害","AUDIO":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20211103_102426.amr","VIDEO":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20211102_050843.3gp","PHOTO1":"http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1褚来友IMG_20211102_171008.jpg","PHOTO2":"","PHOTO3":"","PHOTO4":"","PHOTO5":"","PHOTO6":"","PHOTO7":"","PHOTO8":"","PHOTO9":"","CLIENT_NO":null,"CLIENT_NAME":null}]
      // console.log(this.tableData)
      // this.screeningData()
    },
    // 获取班组长
    async getTeamList () {
      const { data } = await this.$Http.get('/DataListCompany/GetTeamLeaderListApi?ClientNo=' + localStorage.getItem('CLIENT_NO'))
      this.clientList = data
    },
    // 获取环卫工
    async changeClientOptions () {
      var screeningData = this.clientList.filter(item => item.VID === this.form.client)
      const { data } = await this.$Http.get('/DataListCompany/GetWorkerListApi?ClientNo=' + screeningData[0].CLIENT_NO)
      this.teamList = data
      // }
    },
    // 获取车辆班组
    async getcarTeamList () {
      const { data } = await this.$Http.get('/RubbishVehicle/GetGroupList?ClientNo=' + localStorage.getItem('CLIENT_NO'))
      this.carteamList = data
    },
    // 获取车辆
    async changeCarClientOptions () {
      const { data } = await this.$Http.get('/RubbishVehicle/GetVehicleCarListSelect?ClientNo=' + this.form.carteam)
      this.carList = data
      // }
    },
    // 获取指导记录
    async getcommandData () {
      // const { data } = await this.$Http.get('RubbishVehicle/GetCommandList?ID=' + this.form.ID)
      // this.commandData = data
      // this.commandData = [{"ID":"29","CREATETIME":"2021/11/4 10:59:48","TOPLACENAME":"第二菜市场公厕","DETAIL":"抓紧进行水龙头维修替换","STATUS":"已接收"}]
    },
    // 获取反馈记录
    async getrectificationData () {
      const { data } = await this.$Http.get('RubbishVehicle/GetProblemList?ParentID=' + this.form.ID)
      this.rectificationData = data
      // this.rectificationData = [{'zzz':'xx','remark':'都二狗海鹏'},{'zzz':'xx','remark':'都二狗海鹏'},{'zzz':'xx','remark':'都二狗海鹏'}]

    },
    // 指导记录查询
    screeningData () {
      this.currentPage = 1;
      this.commandData = this.originalData
      console.log(this.commandData)
      if (this.form.name) this.commandData = this.commandData.filter(item => item.NAME.includes(this.form.name))

    },

    // 模糊查询
    screeningData () {
      this.currentPage = 1;
      this.tableData = this.originalData
      // if (this.select.name) this.tableData = this.tableData.filter(item => item.NAME.includes(this.select.name))
      console.log(this.tableData)
    },
    async getlistdata1 () {
      this.currentPage = 1;
      this.loading = true
      var url = 'Worker/GetFeedbackInfo2?ClientNo=' + localStorage.getItem('CLIENT_NO') + '&StartDate=' + this.form.StartDate + '&EndDate=' + this.form.EndDate
      // var url = 'Worker/GetFeedbackInfoNew?ClientNo=' + localStorage.getItem('CLIENT_NO') + '&StartDate=' + this.form.StartDate + '&EndDate=' + this.form.EndDate
      const { data } = await this.$Http.get(url)
      // 原始数据
      this.tableData = data
      // this.tableData = [{ "ID": "67", "CLIENT_NO": "00000040101", "ORIENTATION_TIME": "2020/1/3 11:10:56", "ROADNAME": "吴庄北二街", "LOCATION": "中国天津市西青区华天道118号", "DETAIL": "测试", "PHOTO1": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1兰浩IMG_20200103_111000.jpg", "PHOTO2": "", "PHOTO3": "", "PHOTO4": "", "PHOTO5": "", "PHOTO6": "", "PHOTO7": "", "PHOTO8": "", "PHOTO9": "", "Lng": "117.111792307646", "Lat": "39.0944252657748", "RecordPath": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20200103_110854.amr", "VideoPath": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/20200103_110900.3gp", "LONGITUDE": 0.0, "LATITUDE": 0.0, "DIRECTION": null }, { "ID": "66", "CLIENT_NO": "00000040102", "ORIENTATION_TIME": "2020/1/2 15:09:16", "ROADNAME": "测试1", "LOCATION": "中国天津市西青区楚雄西道", "DETAIL": "嗯", "PHOTO1": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1勾志超IMG_20200102_150907.jpg", "PHOTO2": "", "PHOTO3": "", "PHOTO4": "", "PHOTO5": "", "PHOTO6": "", "PHOTO7": "", "PHOTO8": "", "PHOTO9": "", "Lng": "117.108534794014", "Lat": "39.1010641181183", "RecordPath": null, "VideoPath": null, "LONGITUDE": 0.0, "LATITUDE": 0.0, "DIRECTION": null }, { "ID": "65", "CLIENT_NO": "00000040101", "ORIENTATION_TIME": "2020/1/2 14:46:59", "ROADNAME": "吴庄二路北", "LOCATION": "中国天津市西青区华天道5号", "DETAIL": "行行行", "PHOTO1": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-2兰浩IMG_20200102_144145.jpg", "PHOTO2": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1兰浩IMG_20200102_144145.jpg", "PHOTO3": "", "PHOTO4": "", "PHOTO5": "", "PHOTO6": "", "PHOTO7": "", "PHOTO8": "", "PHOTO9": "", "Lng": "117.111588381572", "Lat": "39.0941872627973", "RecordPath": null, "VideoPath": null, "LONGITUDE": 0.0, "LATITUDE": 0.0, "DIRECTION": null }, { "ID": "64", "CLIENT_NO": "00000040101", "ORIENTATION_TIME": "2020/1/2 14:46:49", "ROADNAME": "吴庄二路北", "LOCATION": "中国天津市西青区华天道5号", "DETAIL": "行行行", "PHOTO1": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-2兰浩IMG_20200102_144145.jpg", "PHOTO2": "http://photo-srw-hb2.oss-cn-beijing.aliyuncs.com/fk-Android-1兰浩IMG_20200102_144145.jpg", "PHOTO3": "", "PHOTO4": "", "PHOTO5": "", "PHOTO6": "", "PHOTO7": "", "PHOTO8": "", "PHOTO9": "", "Lng": "117.111588381572", "Lat": "39.0941872627973", "RecordPath": null, "VideoPath": null, "LONGITUDE": 0.0, "LATITUDE": 0.0, "DIRECTION": null }]
      this.loading = false
    },
    // 导出Excel
    // exportExcel () {
    //   let excelName = '移动状态信息表'
    //   const tHeader = ['车辆ID', '车辆名称', '车辆分组', '车辆类型', '移动状态', '移动时间', '开始移动时间', '最后移动时间']
    //   const filterVal = ['VID', 'LICENSE_PLATE', 'CAR_TYPE', 'CLIENT_NAME', 'IsRun', 'RunTime', 'BEGINDATE', 'ENDDATE']
    //   export2Excel(tHeader, filterVal, this.tableData, excelName)
    // },
    // 放大图片
    bigImage (row) {
      // this.srcBig = row.PHOTO1
      this.imageList = []
      if (row.PHOTO1 != '') {
        this.imageList.push(row.PHOTO1)
      }
      if (row.PHOTO2 != '') {
        this.imageList.push(row.PHOTO2)
      }
      if (row.PHOTO3 != '') {
        this.imageList.push(row.PHOTO3)
      }
      if (row.PHOTO4 != '') {
        this.imageList.push(row.PHOTO4)
      }
      if (row.PHOTO5 != '') {
        this.imageList.push(row.PHOTO5)
      }
      if (row.PHOTO6 != '') {
        this.imageList.push(row.PHOTO6)
      }
      if (row.PHOTO7 != '') {
        this.imageList.push(row.PHOTO7)
      }
      if (row.PHOTO8 != '') {
        this.imageList.push(row.PHOTO8)
      }
      if (row.PHOTO9 != '') {
        this.imageList.push(row.PHOTO9)
      }
      this.showBigDialogVisible = true
    },
    playRecord (index, row) {
      var recordPath = row.RecordPath
      var player = $('<amr src="' + recordPath + '"  crossOrigin="anonymous"></amr>')
      player = new amrEvent($(player));
      player && player.play(function (playing) {
        console.log("current player playing ?? " + playing)
      })
    },
    //播放语音
    openRecording (index, row) {
      let url = row.RecordPath
      // let url = _url.split('.com')[1]
      let vm = this
      if (vm.playRec !== null) {
        vm.stopPlayVoice()
      }
      vm.playRec = new BenzAMRRecorder()
      //⚠️注意跨域问题
      vm.playRec.initWithUrl('/record' + url).then(function () {
        vm.voiceActive = index
        vm.playRec.play()
        vm.playRec.onEnded(function () {
          vm.voiceActive = null
        })
      }).catch((e) => {
        console.log(e)
        vm.$message.error('播放录音失败')
      })
    },
    //停止播放
    stopPlayVoice () {
      if (this.playRec.isPlaying()) {
        this.playRec.stop()
      }
    },
    playVideo (index, row) {
      if (row.VideoPath != '' && row.VideoPath != null) {
        this.videoPath = row.VideoPath
        this.showVideoDialogVisible = true;
      } else {
        this.$message.error('未上传视频')
      }

    },
    // 分页导航
    handlePageChange (currentPage) {
      this.currentPage = currentPage;
      // console.log(this.currentPage)
      // this.$set(this.query, 'pageIndex', val);
      // this.getData();
    },
    handleSizeChange (size) {
      this.pageSize = size;
      console.log(this.pageSize)
    },

    // 打开反馈记录
    rectificationRecord (index, row) {
      this.form = Object.assign({}, this.form, row);
      this.showRecordVisible = true
      this.getrectificationData()
    },
    // 打开指导记录
    guidanceRecord (index, row) {
      this.form = Object.assign({}, this.form, row);
      this.showGuidanceVisible = true
      this.getcommandData()
    },
    // 打开添加指导窗口
    handleAdd (index, row) {
      this.form = Object.assign({}, row);
      this.addDialogTitle = '过程指导'
      //展示窗口
      this.isVisibleEdit = true;
      // this.idEdit = false;
    },
    // 打开添加指导窗口
    handleAdd1 (index, row) {
      this.form = Object.assign({}, row);
      this.addDialogTitle = '过程指导'
      //展示窗口
      this.isVisibleEdit1 = true;
      // this.idEdit = false;
    },
    // 下发指导
    async addCommand () {
      // var carset = this.form.car.join(",");
      // var workerset = this.form.team.join(",");
      const params = {
        ID: this.form.ID,
        TOPLACENAME: this.form.PLACENAME,
        DETAIL: this.form.guidance,
      }
      console.log('下发指令：')
      console.log(params)
      const { data } = await this.$Http.get('RubbishVehicle/AddCommand', { params })
      if (data.IsSucess) {
        this.$message.success('下发指导成功')
        this.isVisibleEdit = false
      } else {
        this.$message.error('下发指导成功失败');
      }
    },
    // 下发指导
    async addCommand1 () {
      this.$message.success('下发指导成功')
      this.isVisibleEdit1 = false
    },
    // 选择某一个下拉框
    selectCar () {

      const item = this.carList.find(item1 => item1.LICENSE_PLATE === this.car)
      console.log(item)
      this.form.guidance = item.LICENSE_PLATE

    },
  }
}
</script>
<style>
.content {
  overflow-y: scroll;
}
.el-col-6 {
  width: 350px;
  min-height: 50px;
}
.el-table th {
  height: 40px;
}
.el-form-item label {
  width: 80px;
}
</style>